#include "ACUAS\ACUAS.h"
#include "ACUAS\ACUASlcd.h"

PROGRAM_INIT
	ACTIVATE_ADC
	ACTIVATE_LCD
	float x,y,calx=6.43, caly=6.07;
	int initx, inity;
	initx=0;
	inity=0;

PROGRAM_START
	
	ADC_CHANNEL(1)
	ADCONVERT_MV(x)
	ADC_CHANNEL(2)
	ADCONVERT_MV(y)

	ON_BUTTON(4)
	{
		initx=x;
		inity=y;
	}
	x=x-initx;
	x=x/calx;

	LCD_XY(1,1)
	LCD_NUMBER(x)
	LCD_TEXT("  ")

	
	y=y-inity;
	y=y/caly;


	LCD_XY(1,2)
	LCD_NUMBER(y)
	LCD_TEXT("  ")
	ON_JOYSTICK_UP calx = calx + 0.01;
	ON_JOYSTICK_DOWN calx = calx - 0.01;
	ON_JOYSTICK_RIGHT caly = caly +0.01;
	ON_JOYSTICK_LEFT caly = caly - 0.01;
PROGRAM_END

